import type * as Login from "./type"
import { request } from "@/http/axios"
import {Reactive} from "vue";

/** 获取登录验证码 */
export function getLoginCodeApi() {
  return request<Login.LoginCodeResponseData>({
    url: "user/code",
    method: "post"
  })
}

/** 登录并返回 Token */
export function loginApi(data: Reactive<{ password: string; code: string; username: string }>) {
  return request<Login.LoginResponseData>({
    url: "user/login",
    method: "post",
    data
  })
}
